import request from '@/utils/request'

// 查询请假列表
export function listLeaves(query) {
  return request({
    url: '/wsd_leaves/list',
    method: 'get',
    params: query
  })
}
//查询请假今天的请假数量
export function getLeavetotal(query){
  return request({
    url:'/wsd_leaves/leave_statistics',
    method:'get',
    params:query
    // params:{
    //       "beginDate": "2024-04-24 00:00:00",
    //       "endingDate": "2024-04-24 23:59:59"
    //    }
  })
}
// 查询请假详细
export function getLeaves(id) {
  return request({
    url: '/wsd_leaves/' + id,
    method: 'get'
  })
}

// 新增请假
export function addLeaves(data) {
  return request({
    url: '/wsd_leaves',
    method: 'post',
    data: data
  })
}

// 修改请假
export function updateLeaves(data) {
  return request({
    url: '/wsd_leaves',
    method: 'put',
    data: data
  })
}

// 删除请假
export function delLeaves(id) {
  return request({
    url: '/wsd_leaves/' + id,
    method: 'delete'
  })
}
